# -*- coding: utf-8 -*-
from datetime import datetime
import pandas as pd
import numpy as np

if __name__ == '__main__':
    print pd.date_range("2018-01-01", "2018-01-10", freq="D")
    print pd.date_range("2018-01-01", "2018-01-10", freq="2D")
    print "---------偏移量通过加法连接---------------------------"
    offset_ = pd.tseries.offsets.Week(2) + pd.tseries.offsets.Hour(12)
    print offset_
    print pd.date_range("2018-01-01", "2018-03-01", freq=offset_)
    print "---------移动数据--------------------------"
    ts = pd.Series(np.random.randn(5), index=pd.date_range('20180101', periods=5, freq="W-SAT"))
    print ts
    print ts.shift(1)
    print ts.shift(-1)